home *** CD-ROM | disk | FTP | other *** search
- Path: rz.uni-karlsruhe.de!ma2s2!haible
- From: haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible)
- Newsgroups: comp.lang.lisp,comp.lang.c++
- Subject: Re: Why garbage collection?
- Date: 26 Jan 1996 11:33:16 GMT
- Organization: University of Karlsruhe, Germany
- Message-ID: <4eae5s$66p@nz12.rz.uni-karlsruhe.de>
- References: <rvillDL4v3n.I8r@netcom.com> <hbaker-2201961503250001@10.0.2.15>
- NNTP-Posting-Host: ma2s2.mathematik.uni-karlsruhe.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- Keywords: garbage collection, c++, tradition
- Originator: haible@ma2s2
-
- Prof. Henry Baker <hbaker@netcom.com> wrote:
- >
- > The other thing I'd like to do is to ask the ACM to embargo any textbooks
- > that continue to prattle on about how bad GC is. Unfortunately, these
- > textbooks lend credence to the old adage "If you can, do; if you can't,
- > write a bad textbook".
-
- Please start with the textbook "C++ for C programmers", by Ira Pohl,
- 2nd edition. On page 268, he writes:
-
- " Other complexity issues are fundamental to the C++ language design,
- such as the lack of garbage collection (GC). Several proposals exist
- [4][5][6], and their implementations support the contention that they
- can be done without degrading performance in most applications. Most
- other major OOP languages, such as Smalltalk, CLOS, and Eiffel, support
- GC. The argument for GC is that it makes the programmer's task distinctly
- easier. Memory leaks and pointer errors are common when each class
- provides for its own storage management. These are very hard errors to
- find and debug. GC is a well-understood technology, so why not?
-
- " The argument against GC is that it extracts a hidden cost from all
- users when employed universally. Also, GC manages memory but not other
- resources. This would require destructors for _finalization_.
- Finalization is the return of resources and other behavior when an
- object's lifetime is over. For example, the object might be a file,
- and finalization might require closing the file. Finally, it is not
- in the tradition of the C community to have free store managed
- automatically."
-
- [4] Hans-J. Boehm and Mark Weiser. "Garbage Collection in an Uncooperative
- Environment." Software - Practice and Experience, Sept. 1988,
- pp. 807-820.
-
- [5] Daniel Edelson and Ira Pohl. "A Copying Collector for C++." In
- Usenix C++ Conf. Proc. 1991, pp. 85-102.
-
- [6] Daniel Edelson. "A Mark and Sweep Collector for C++." In Proc. Princ.
- Prog. Lang., January 1992.
-
-
- Just look at the technical strength of the argument that GC is not
- "in the tradition of the C community"...
-
- Bruno Haible
-
-